from globals2 import *
import gobject

def move(x,y):
   global TUX_X
   global TUX_Y
   s = area.get_style()
   gc = s.fg_gc[gtk.STATE_NORMAL]
   pixmap, mask = gtk.gdk.pixmap_create_from_xpm(area.window, s.bg[gtk.STATE_NORMAL], "img/tux.xpm")
   if (PENDOWN == True):
      area.window.draw_line(gc, TUX_X, TUX_Y, x, y)
   area.window.draw_drawable(gc, pixmap, 0, 0, x, y, 20, 20)
   TUX_X = x
   TUX_Y = y

# CALL: go(x, y)
def go(x, y):
   global TIME
   global DELAY
   gobject.timeout_add(TIME, move, x, y)
   TIME+=DELAY
   print TIME
